package com.zhiming.item.cotroller;


import com.zhiming.item.pojo.Carousel;
import com.zhiming.item.service.CarouselService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 首页轮播图 Controller
 */

@RestController
@Slf4j
public class CarouselController {
    @Autowired(required = false)
    private CarouselService carouselService;

    /**
     *查询轮播图
     */
    @GetMapping("/carousel")
    public ResponseEntity<List<Carousel>> findAll(){
        log.info("【查询轮播图】");
        List<Carousel> carouselList = carouselService.findAll();
        return ResponseEntity.ok(carouselList);
    }

}
